<template>
  <div class="App" >
    <h2>App组件</h2>
    <p>用户访问量{{userName | Nums }}</p>
    <p>price1:{{price1 | priceFormat(2) }}</p>
    <Count />
  </div>
</template>

<script>
import Count from "@/components/Count"
export default {
  name: "App",
  data() {
    return {
      userName:12342234,
      price1:12.22,
      price2:15.88
    };
  },
  // 局部
  filters:{
    Nums(value){
      const reg = /(\d)(?=(\d{3})+$)/g
      return String(value).replace(reg,"$1,")
    }
  },
  components:{
    Count
  }
};
</script>
